home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / nameless.swf / scripts / DefineSprite_15_fish / frame_1 / DoAction.as
Encoding:
Text File  |  2011-06-09  |  529 b   |  32 lines

  1. stop();
  2. if(!setVars)
  3. {
  4.    startFrame = _root._currentframe;
  5.    setVars = true;
  6. }
  7. var onEnterFrame = function()
  8. {
  9.    if(_root._currentframe != startFrame)
  10.    {
  11.       removeMovieClip(this);
  12.    }
  13.    moveSpeed = 6;
  14.    if(_Y < -50)
  15.    {
  16.       removeMovieClip(this);
  17.    }
  18.    else
  19.    {
  20.       _rotation = _rotation + moveSpeed;
  21.       _Y = _Y - moveSpeed;
  22.    }
  23.    if(_root.cm.hit.hitTest(this))
  24.    {
  25.       if(_currentframe == 1)
  26.       {
  27.          _root.health -= 10;
  28.          gotoAndStop(2);
  29.       }
  30.    }
  31. };
  32.